﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Drawing;

using System.Windows.Forms;

using DotSpatial.Topology;




namespace FXnaGis
{
    public class FCircleMF:FMapFunction
    {
        public FCircleMF(FMapFrame frame)
            : base(frame)
        {

            this._enabled = false;
 
        }




        bool _isBegin=false;

        Coordinate _center;

        System.Drawing.Point _mousePositon;


        protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
        {
            base.OnMouseDown(e);

            if (e.Button==System.Windows.Forms.MouseButtons.Left)
            {

                if (_isBegin)
                {

                    //结束绘制并激活事件

                    this.FinishCircle();

                    this._isBegin = false;




                }
                else
                {

                    //第一次点鼠标

                    this._isBegin = true;

                    this._center = this._geoMapFrame.BufferToProj(e.Location);


                }



                
            }


        }


        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);

            if (this._isBegin)
            {

                this._mousePositon = e.Location;

                
            }

        }



        protected override void OnDraw(FMapDrawArgs e)
        {
            
            base.OnDraw(e);

            if (this._isBegin)
            {

                //这里我们绘制一个中心点，加一个外边

                

                
            }

            




        }


        protected void FinishCircle()
        {
 
        }



    }
}
